
#ifndef __CORE_CLIENT_H__
#define __CORE_CLIENT_H__

#include "core_buff.h"
#include "core_stream.h"
#define RECV_BUFF_SIZE 1024
#define SEND_BUFF_SIZE 1024
#define PACKET_HEAD_LEN 4
class CoreClient
{
public:
	enum ClientState
	{
		CLIENT_STATE_INIT = 0,
		CLIENT_STATE_LOGINED = 1,
		CLIENT_STATE_TO_CLOSE = 2
	};
private:
	int cellid;
	int socketfd;
	CoreBuff recvbuff;
	CoreBuff sendbuff;
public:
	CoreClient(int cellid,int socketfd);
	virtual ~CoreClient();
	int getsockfd();
	int dataReceived();
	int parselen();
	char* getMessage();
	void delMessage(int len);
};

#endif